//联合类型

let Arrlist: { a: number, b: string, c: boolean } | {} | { z: string } = {
    a: 111,
    b: '哈哈哈哈',
    c: false,
    z: '哪好'
}
console.log(Arrlist);


//断言
const str23 = "巨大石块" as string
console.log(str23);


//viod
function warnuser(): void {
    console.log('圣诞节喀什电话卡技术的');

}
console.log(warnuser);

//viod
let unusal: void = undefined
console.log(unusal);


//never 
function error(messahe: string): never {
    throw new Error('你哈啊看')
}
console.log(error);

//es5
function a1(a, b) {
    return a + b
}
console.log(a1(1, 2));

//ts
function sun(a: number, b: number) {
    return a + b
}
console.log(sun(300, 50));

//es5
function class1(a1) {
    return a1

}
console.log(class1('你好'));

//es6
const class2 = (q) => {
    return q

}
console.log(class2(11));


//继承
class Animal {
    move(distanceInMeters: number = 0) {
        console.log(`绝对是克拉克决定了${distanceInMeters}`);

    }
}
class Dog extends Animal {
    bark() {
        console.log('点击开始');

    }
}
const dog = new Dog()
dog.bark()
dog.move(10)
dog.bark()


//定义数组
const list21: number[] = [1, 2, 3, 4]
console.log(list21);

const list32: Array<number> = [1, 2, 3, 4, 5]
console.log(list32);



//求和
function qiouhe(a: number, b: number, c: number, d: number, e: number, f: number, j: number) {
    return a + b + c + d + e + f + j
}
console.log(qiouhe(2, 8, 9, 6, 5, 8, 7));


function s1(a: boolean, c: string) {
    if (!s1) {
        false
    }
}
console.log(s1);



function mopo(patterns: string[], word: string): number {
    patterns = ["a", "abc", "bc", "d"], word = "abc"
}

console.log(mopo);
